#include <cstring>
#include <iostream>
#include <random>
#include <chrono>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
const int N = 1e5 + 5;
long long HarryPotterHashRand(const char *OriginalString) {
    char newString[0x3f3f];
    long long HashMOD = 101411234562527ll;
    memset(newString, 0, sizeof(newString));
    if (strlen(OriginalString) > 0x3f3e) return ((long long)(0xffffffff) - strlen(OriginalString));
    strcpy(newString + 1, OriginalString);
    long long seed = 111111111111111ll;
    for (int i = 1; newString[i] > 0; ++ i) {
        seed ^= (long long)(newString[i]) << 26;
        seed = ((seed << 1) + (seed << 2)) + (((long long)(newString[i]) << 34) * 10ll);
        seed *= newString[i] * 0xf;
        seed = (seed + HashMOD) % HashMOD;
    }
    return seed;
}
long long arr[N];
unordered_map<long long, int> M;
vector<long long> Kr;
typedef pair<long long, string> PLS;
vector<PLS> Sr;
signed main() {
    freopen("C:\\Users\\lenovo\\Desktop\\1.in", "w", stdout);
    long long n = 35000, k = 30000, c = 11000;
    long long res = 0, sum = 0; 
    for (int i = 1; i <= c; ++ i) arr[i] = rng(), sum += arr[i];
    for (int i = 1; i <= c; ++ i) arr[i] = (n * arr[i] / sum) + (n * arr[i] % sum > sum / 3 ? 1 : 0) , res += arr[i];
    n = res;
    cout << n << ' ' << k << ' ' << c << '\n';
    for (int i = 1; i < c; ++ i) printf("%lld ", arr[i]); printf("%lld\n", arr[c]);
    for (int i = 1; i <= n; ++ i) {
        int pd; string s;
        onte:
        pd = rng() % 1024 + 1;
        s = "";
        for (int j = 1; j <= pd; ++ j) {
            int rngnum = rng() % 52;
            s += (char)(rngnum >= 26 ? rngnum - 26 + 'a' : rngnum + 'A');
        }
        //cout << s << endl;
        long long kk = HarryPotterHashRand(s.c_str());
        
        if (M[kk] == 1) {
            goto onte;
            cout << M[kk] << "bug!" << endl;
            return 0;
        } else ++ M[kk];
        Kr.push_back(kk);
        Sr.push_back({kk, s});
    }
    sort(Sr.begin(), Sr.end());
    for (auto i : Sr) printf("%s\n", i.second.c_str());
    for (int i = 1; i <= k; ++ i) {
        int kk = rng() % n;
        printf("%lld\n", Kr[kk]);
    }

    return 0;
}